package com.example.aidl;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

import com.googlecode.androidannotations.annotations.Bean;
import com.googlecode.androidannotations.annotations.EService;

@EService
public class AIDLService extends Service {
	@Bean
	People people=new People();
	PeopleAIDL.Stub stub=new PeopleAIDL.Stub() {
		//下面的方法都是供远程调 用 的
		public void setName(String name) throws RemoteException {
			// TODO Auto-generated method stub
			people.setName(name);
		}
		
		public void setAge(int age) throws RemoteException {
			// TODO Auto-generated method stub
			people.setAge(age);
		}
		
		public void say() throws RemoteException {
			// TODO Auto-generated method stub
			people.say();
		}
	};
	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		//onBind方法要返回PeopleAIDL.Stub
		return stub;
	}
	
}
